package com.example.blogdesign.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {
    private Boolean success;
    private String Msg;
    private T data;


    public static <T> Result<T> ok(){
        return new Result<>(true, null, null);
    }
    public static <T> Result<T> ok(String msg){
        return new Result<>(true, msg, null);
    }
    public static <T> Result<T> ok(T data){
        return new Result<>(true, null, data);
    }
    public static <T> Result<T> fail(String msg){
        return new Result<>(false, msg, null);
    }

}
